//
//  SAPFindCarTwoModel.m
//  CarsHome
//
//  Created by dapeng on 15/12/4.
//  Copyright © 2015年 dapeng. All rights reserved.
//

#import "SAPFindCarTwoModel.h"

@implementation SAPFindCarTwoModel
- (instancetype)initWithDataSource:(NSDictionary *)data {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:data];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"list"]) {
        NSArray *array = value;
        NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:0];
        for (NSDictionary *dic in array) {
            SAPFindCarThreeModel *threeModel = [[SAPFindCarThreeModel alloc] initWithDataSource:dic];
            [mutableArray addObject:threeModel];
            NSLog(@"%@", threeModel.id);
        }self.listArray = [NSArray arrayWithArray:mutableArray];
    
    }if ([key isEqualToString:@"serieslist"]) {
        NSArray *array = value;
        NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:0];
        for (NSDictionary *dic in array) {
            SAPFindCarThreeModel *threeModel = [[SAPFindCarThreeModel alloc] initWithDataSource:dic];
            [mutableArray addObject:threeModel];
        }self.serieslistArray = [NSArray arrayWithArray:mutableArray];
        
    }

}
- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}

@end
